package com.alks.function.controller.finance.salary;


import com.alks.common.aop.ApiRestController;
import com.alks.common.aop.RoleCheck;
import com.alks.common.aop.WebLogger;
import com.alks.entity.data.response.ResponseInfo;
import com.alks.function.data.request.finance.salary.PcBonusEndMonthRequest;
import com.alks.function.service.finance.salary.SealAccountService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;


@Slf4j
@Api(value = "财务部-工厂-人工薪资作业", tags = {"财务部-件资封账作业"})
@ApiRestController("/SealAccount")
@RoleCheck(prgIds = {"180307"})
public class SealAccountController {

    @Autowired
    private SealAccountService sealAccountService;

    @WebLogger
    @PostMapping("/getProductAccountDetails")
    @ApiOperation(value = "查询：员工产值核算封账月份明细",tags = "财务部-件资封账作业")
    public ResponseInfo getProductAccountDetails(@RequestBody PcBonusEndMonthRequest request){
        return sealAccountService.getProductAccountDetails(request);
    }

    @WebLogger
    @PostMapping("/updateProductAccountDetails")
    @ApiOperation(value = "编辑封帐月份：员工产值核算封账月份明细",tags = "财务部-件资封账作业")
    public ResponseInfo updateProductAccountDetails(@RequestBody PcBonusEndMonthRequest request){
        return sealAccountService.updateProductAccountDetails(request);
    }

    @WebLogger
    @PostMapping("/addProductAccountDetails")
    @ApiOperation(value = "添加数据：员工产值核算封账月份明细",tags = "财务部-件资封账作业")
    public ResponseInfo addProductAccountDetails(@RequestBody PcBonusEndMonthRequest request){
        return sealAccountService.addProductAccountDetails(request);
    }

    @WebLogger
    @PostMapping("/deleteProductAccountDetails")
    @ApiOperation(value = "删除：员工产值核算封账月份明细",tags = "财务部-件资封账作业")
    public ResponseInfo deleteProductAccountDetails(@RequestBody PcBonusEndMonthRequest request){
        return sealAccountService.deleteProductAccountDetails(request);
    }

}